/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "t_user")
//@NamedQueries({@NamedQuery(name = "TUser.findAll", query = "SELECT t FROM TUser t"), @NamedQuery(name = "TUser.findByUserId", query = "SELECT t FROM TUser t WHERE t.userId = :userId"), @NamedQuery(name = "TUser.findByEmployeeId", query = "SELECT t FROM TUser t WHERE t.employeeId = :employeeId"), @NamedQuery(name = "TUser.findByRoleId", query = "SELECT t FROM TUser t WHERE t.roleId = :roleId"), @NamedQuery(name = "TUser.findByCtrlDate", query = "SELECT t FROM TUser t WHERE t.ctrlDate = :ctrlDate"), @NamedQuery(name = "TUser.findByUserPwd", query = "SELECT t FROM TUser t WHERE t.userPwd = :userPwd"), @NamedQuery(name = "TUser.findByAuthTupe", query = "SELECT t FROM TUser t WHERE t.authTupe = :authTupe"), @NamedQuery(name = "TUser.findByCanAccess", query = "SELECT t FROM TUser t WHERE t.canAccess = :canAccess")})
public class TUser implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "user_id")
    private String userId;
    @Column(name = "employee_id")
    private String employeeId;
    @Column(name = "role_id")
    private String roleId;
    @Column(name = "ctrl_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ctrlDate;
    @Column(name = "user_pwd")
    private String userPwd;
    @Column(name = "auth_tupe")
    private String authTupe;
    @Column(name = "can_access")
    private Boolean canAccess;
    @Column(name = "code")
    private String code;

    public TUser() {
    }

    public TUser(String userId) {
        this.userId = userId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public Date getCtrlDate() {
        return ctrlDate;
    }

    public void setCtrlDate(Date ctrlDate) {
        this.ctrlDate = ctrlDate;
    }

    public String getUserPwd() {
        return userPwd;
    }

    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    public String getAuthTupe() {
        return authTupe;
    }

    public void setAuthTupe(String authTupe) {
        this.authTupe = authTupe;
    }

    public Boolean getCanAccess() {
        return canAccess;
    }

    public void setCanAccess(Boolean canAccess) {
        this.canAccess = canAccess;
    }

    public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (userId != null ? userId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TUser)) {
            return false;
        }
        TUser other = (TUser) object;
        if ((this.userId == null && other.userId != null) || (this.userId != null && !this.userId.equals(other.userId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.TUser[userId=" + userId + "]";
    }

}
